package com.infinit.selfhelp.common.ext

import android.content.Context
import android.content.pm.PackageManager

fun Context.getAppVersionName(): String {
    return try {
        val packageInfo = packageManager.getPackageInfo(packageName, 0)
        packageInfo.versionName
    } catch (e: PackageManager.NameNotFoundException) {
        e.printStackTrace()
        "-1"
    }
}